<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>get带参数</title>
</head>
<body>
	<button id='but'>get带参数</button>
	<script type="text/javascript">
	//获取元素
	var but = document.getElementById('but');

	but.onclick = function()
	{
		//1.创建ajax对象
		var x = new XMLHttpRequest;

		//2.绑定事件
		x.onreadystatechange = function()
		{
			if(x.readyState == 4 && x.status == 200){

				console.log(x.responseText);
			}
		}

		//3初始化
		x.open('GET','2.php?id=100&b=200',true);

		//4发送ajax
		x.send();
	}



	</script>
</body>
</html>